/////////////////////////////////////////////////////////////////////////////
// Name:        ax_validator.h
// Purpose:     Validator/Data transfer classes
// Author:      Julian Smart
// Modified by:
// Created:     2009-03-20
// RCS-ID:
// Copyright:   (c) Julian Smart
// Licence:     New BSD License
/////////////////////////////////////////////////////////////////////////////

#ifndef _AX_VALIDATOR_H_
#define _AX_VALIDATOR_H_

class AxMenuItem;
 
/**
 * @class AxValidator
 */

class AxValidator: public wxEvtHandler
{
    DECLARE_CLASS( AxValidator )

public:
// Constructors

    AxValidator() { Init(); }
    ~AxValidator() {}

// Operations

    void Init()
    {
        m_item = NULL;
    }

    void Copy(const AxValidator& validator) { m_item = validator.m_item; }

    /// Override to pass a value from the UI to a data structure
    virtual bool TransferDataFromMenu() { return false; }

    /// Override to pass a value from a data structure to the UI
    virtual bool TransferDataToMenu() { return false; }

    /// Override to make the object clonable
    virtual AxValidator* Clone() const = 0;

    AxMenuItem* GetMenuItem() const { return m_item; }

    void SetMenuItem(AxMenuItem* item) { m_item = item; }

protected:

    AxMenuItem* m_item;
};

#endif
    // _AX_VALIDATOR_H_
